Questions
23 of 30
1What is the purpose of the transform property in CSS?
2What are the different types of CSS transformations?
3What does transform: translate() do?
4What is the difference between translateX() and translateY()?
5How does rotate() work in CSS?
6What is the unit used in rotation?
7What is the difference between scale() and scaleX(), scaleY()?
8What happens when you use negative values in scale()?
9What does the skew() function do?
10Can you combine multiple transform functions together? How? What is the use of the transform-origin property?
11What is the default transform-origin value?
12How does changing transform-origin affect rotation or scaling?
13What is the difference between translate() and using position or margin for movement?
14What is the difference between 2D and 3D transformations?
15What is the difference between 2D and 3D transformations?
16How do you apply a 3D rotation using CSS?
17How do you apply a 3D rotation using CSS?
18What are perspective and perspective-origin in 3D transforms? What is the purpose of transform-style: preserve-3d?
19What is the use of matrix() in CSS transforms?
20What’s the difference between matrix() and matrix3d()?
21How can you center an element using transform and translate()?
22What is the transition property in CSS used for?
23What are the four main components of a transition?
24What does transition-duration specify?
25What are the common timing function values (e.g., ease, linear, ease-in)?
26What is the shorthand syntax for transition?
27Can multiple CSS properties be transitioned simultaneously? How does transition differ from animation in CSS?
28Can you apply a transition to an element’s pseudo-class (like :hover)?
29Can transitions be triggered by JavaScript?
30What happens if transition-duration is set to 0s?
23 / 30

What are the four main components of a transition?

The Four Components of the CSS Transition Property

In CSS, a transition defines how a property changes smoothly from one state to another over a specific period. The transition shorthand property consists of four main components that control how these animations behave.

Components Explained
  1. 1

    transition-property — Specifies which CSS property should transition (e.g., transform, opacity, background-color).

  2. 2

    transition-duration — Defines how long the transition takes to complete (e.g., 0.5s, 2s).

  3. 3

    transition-timing-function — Controls the acceleration curve of the transition (e.g., ease, linear, ease-in-out).

  4. 4

    transition-delay — Determines how long to wait before starting the transition (e.g., 0s, 1s).

Example Syntax
CSS Example

In this example, the box smoothly scales and rotates when hovered. The transition starts after a 0.2-second delay, lasts 0.5 seconds, and uses the ease-in-out timing function for natural motion.

Key Takeaways
  1. 1

    All four components can be written in one shorthand declaration or separately.

  2. 2

    If no transition-property is defined, all is used by default.

  3. 3

    Transitions work best with animatable properties like transform, opacity, and color.